package Demo1299.Demo9;

import java.lang.reflect.Field;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("Demo1299.Demo9.Student");
        Object student = aClass.getDeclaredConstructor().newInstance();
        Field naem = aClass.getDeclaredField("naem");
        naem.setAccessible(true);
        naem.set(student,"小虎");
        Field age = aClass.getDeclaredField("age");
        age.setAccessible(true);
        age.set(student,25);
        System.out.println(student);
    }
}
